package com.riku.security.service;

import com.riku.security.model.SeApiRole;
import com.riku.security.model.SeSecurityApi;
import com.riku.security.model.SeSecurityMenu;
import com.riku.security.model.SeService;

import java.util.List;
import java.util.Set;

/**
 * 该接口获取个人权限
 * Created by 1 on 2021/5/23.
 */
public interface SeCommonService {

    /**
     * 获取账号授权的所有服务
     * @param serviceName
     * @param userId
     * @return
     */
    List<SeService> selectService (String serviceName,String userId);

    /**
     * 获取账号授权的菜单
     * @param serviceCode
     * @param userId
     * @param includeApi
     * @param tree
     * @return
     */
    List<SeSecurityMenu> selectMenuByUserId(String serviceCode,String userId,Integer includeApi,Integer tree);

    /**
     * 获取账号授权的接口
     * @param serviceCode
     * @param userId
     * @return
     */
    List<SeSecurityApi> selectApiByUserId(String serviceCode,String userId);

    /**
     * 根据服务code获取所有角色权限
     * @param userId
     * @param serviceCodes
     * @return
     */
    List<Long> getApiSecurityForLogin(String userId, String ...serviceCodes);

    /**
     * 获取服务的所有API
     * @param serviceCode
     * @return
     */
    List<SeApiRole> getApiAndRole(String serviceCode);

    /**
     * 根据角色id获取所有权限
     * @param userId
     * @param roleIds
     * @return
     */
    Set<String> getApiSecurityForLogin(String userId, Long ...roleIds);
}
